<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        width: 100%;
        height: 600px;
      }
    </style>
  </head>
  <body></body>
  <script>
    document.body.addEventListener(
      "touchstart",
      function () {
        console.log("touchstart");
      },
      false
    );

    document.body.addEventListener(
      "touchmove",
      function () {
        alert();
        console.log("touchmove");
      },
      false
    );

    // 事件绑定写法，要在事件名前加on
    document.body.ontouchend = function () {
      console.log("touchend");
    };

    document.body.ontouchcancel = function(){
        console.log("touchcancel");
    }
  </script>
</html>
